home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / dskut / what20.zip / README < prev    next >
Text File  |  1988-08-14  |  1KB  |  39 lines

  1.  
  2.  
  3. Here is a Unix utility (with source) for MS-DOS. I compiled with MSC 5.1,
  4. but it is ANSI C with only file opening MS-DOS specific code.
  5.  
  6. It looks for a key text string in a file (any file: source text, binary
  7. object, or executable).  When the key string @(#) is found, all following
  8. text up to a newline, null, double quote, or backslash is printed.
  9. Try:
  10. what what.com
  11.  
  12. Why what?  First of all, to identify executable files.  This utility
  13. lets you know what version an executible is.  It is also very useful for
  14. library routines, both for checking which version is used and also to
  15. see what routines actually get loaded at link time.
  16.  
  17. To use what in C, include a static character string like this:
  18.  
  19. static char *ID = "@(#)id.c: version 12.8 74-04-12 Fred Rogers";
  20.  
  21. in any module to be compiled (see attached source for example).
  22. The static is used to avoid conflicts with other ID's in other modules.
  23. The same idea can be used for assembler:
  24.  
  25. CONST      SEGMENT
  26. $SG101    DB    '@(#) sline.asm: PC Graphics Library  1.0 88/06/15 Copyright '
  27.     DB    '1988 R. Coates',  00H
  28. CONST      ENDS
  29.  
  30. This would be handy if people sending things to comp.binaries.ibm.pc used
  31. this, then the executibles can be easily identified even if the original
  32. distribution were lost, or confused with updates.
  33.  
  34. The .COM file included uses MS-DOS wildcard expansion, so 
  35. what *.exe
  36. should work.
  37.  
  38. Rick Coates
  39.